		$(function() {
			var tableSource = new $.jqx.dataAdapter({
				dataType: "json",
				dataFields:[
				    { name: "id", type: "int" },
				    { name: "title", type: "string" },
				    { name: "content", type: "string" },
				    { name: "createtime", type: "date" },
				    { name: "updatetime", type: "date" },
			  	    { name: "creator", type: "string" },
				    { name: "mender", type: "string" }
				],
				id: "id",
				url: "broadcast/all.do"
			});
			$("#dataTable").jqxDataTable({
				width: "100%",
		        source: tableSource,
                pageable: true,
                pageSize: 18,
                serverProcessing: true,
                pagerButtonsCount: 10,
		        columnsResize: true,
		        sortable: true,
		        columns: [
		            { text: "序号", width: 50, cellsRenderer: function(row){ return (row + 1).toString(); } },
		            { text: "标题", dataField: "title" },
		            { text: "创建者", dataField: "creator" },
		            { text: "创建时间", dataField: "createtime", width: 130,
		            	cellsRenderer: function(row, column, value, rowData){
		            		return format(value, "Y-M-D H:I");
		            	}
		            }
		        ],
			});
			$("#dataTable").on("rowDoubleClick",function(info, args) {
				if(args && args.flag){
					info = args;
				}
				var type = info.args.type;
				editingIndex = info.args.index;
				editingData = info.args.row;
			 	_editerIndex = layer.open({
					id: "broadcastEditer",
					title: "查看消息详情",
				    type: 1,
				    skin: 'layui-layer-rim',
				    area: ['1000px', '680px'],
				    content: 
				    	type == "add"?(
				    			'<div id="broadcast-editer" class="form" style="height: 100%;overflow: auto;">' +
				    			'<input type="hidden" name="submit-url" />' +
				    			'<label class="from-label" for="title">标题：</label>' +
				    			'<input type="text" allowBlank="false" name="title" class="form-control" placeholder="标题" style="width:820px;" />' +
				    			'<label class="from-label" for="content">内容：</label>' +
				    			'<textarea name="content" allowBlank="false" unallows="<div>​</div>" id="content" class="form-control" placeholder="内容" style="width:820px;height:500px;resize:none;"></textarea>' +
				    			'<br><br><br>' +
				    			'</div>' +
				    			'<div class="form" style="position: absolute;bottom: 0px;width: 100%;text-align: right;background-color: #DDD;">' +
				    			'<input type="button" class="btn btn-sm btn-success" onclick="submitEditer(this)" value="保存"/>' +
				    			'<input type="button" class="btn btn-sm btn-info" onclick="closeEditer(this)" value="返回"/>' +
				    			'</div>'
				    	):(
				    			'<div id="broadcast-editer" class="form" style="height: 100%;overflow: auto;">' +
				    			'<label class="from-label" for="title">标题：</label>' +
				    			'<input type="text" name="title" class="form-control" placeholder="标题" readonly="true" style="width:820px;" />' +
				    			'<br><label class="from-label" for="content">内容：</label>' +
				    			'<div name="content" class="form-control" readonly="true" style="width:820px;min-height:500px;height:auto;"></div>' +
				    			'<br><br><br>' +
				    			'</div>' +
				    			'<div class="form" style="position: absolute;bottom: 0px;width: 100%;text-align: right;background-color: #DDD;">' +
				    			'<input type="button" class="btn btn-sm btn-info" onclick="closeEditer(this)" value="返回"/>' +
				    			'</div>'
					)
				});
			 	setData($("#broadcast-editer"), editingData);
			 	if(type){
		            $('#content').jqxEditor({
		            	width: 820,
		            	height: 500,
		            	tools: "bold italic underline | format font size | color background | left center right | outdent indent | ul ol | image | link | clean",
		            });
			 	}
			});
		});